package L1;

import java.util.Scanner;

public class _009 {
	public static void print(int ff,int mm)
	{
		if(ff==0)
			return ;
		else
		{
			int tempff=ff,tempmm=mm;
			 while (ff%mm!=0) {   
		            int temp=ff%mm;   
		            ff=mm;   
		            mm=temp;   
		        }   
			 System.out.print(tempff/mm+"/"+tempmm/mm);
		}
	}

	public static void main(String[] args) {
		Scanner reader=new Scanner(System.in);
		int number=reader.nextInt();
		String str[]=new String[number];
		int str1[]=new int[number];
		int str2[]=new int[number];
		int space,mm=1;
		for(int i=0;i<str.length;i++)
		{
			str[i]=reader.next();
			space=str[i].indexOf('/');
			str1[i]=Integer.parseInt(str[i].substring(0,space));
			str2[i]=Integer.parseInt(str[i].substring(space+1));
			mm*=str2[i];
			//System.out.println(str1[i]+"  "+str2[i]);
		}
		//System.out.println(ff+"    "+mm);
		int ff=0;
		for(int i=0;i<str.length;i++)
		{
			ff+=str1[i]*(mm/str2[i]);
		}
		//System.out.println(ff+"    "+mm);
		if(ff<mm)
			print(ff,mm);
		else
		{
			if(ff%mm!=0)
			{
				System.out.print(ff/mm+" ");
				print(ff-(ff/mm)*mm,mm);
			}	
			else
			{
				System.out.print(ff/mm);
			}
		}
		reader.close();
	}

}
